package com.ssy.lingxi.member.merchant.api.feign.paas;

import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.PlatformProcessRuleVO;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.RoleAuthVO;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.RoleConfigVO;
import com.ssy.lingxi.member.merchant.api.model.vo.paas.RoleVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;

/**
 * 角色管理接口
 * @author 万宁
 * @version 2.0.0
 * @date 2020-07-01
 */
@FeignClient(name = "merchant-member-service")
@RequestMapping("/paas/role")
public interface RoleControllerFeign {

    /**
     * 新增角色
     * @param roleVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    Wrapper<Long> addRole(@RequestBody @Validated(RoleVO.Add.class) RoleVO roleVO);

    /**
     * 更新角色
     * @param roleVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    Wrapper<?> updateRole(@RequestBody @Validated(RoleVO.Update.class) RoleVO roleVO);

    /**
     * 更改角色状态
     * @param roleVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/status", method = RequestMethod.POST)
    Wrapper<?> updateRoleStatus(@RequestBody @Validated(RoleVO.UpdateStatus.class) RoleVO roleVO);

    /**
     * 删除角色
     * @param roleVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/delete", method = RequestMethod.POST)
    Wrapper<?> deleteRole(@RequestBody @Validated(RoleVO.Delete.class) RoleVO roleVO);

    /**
     * 设置角色权限
     * @param roleAuthVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/set/auth", method = RequestMethod.POST)
    Wrapper<?> setRoleAuth(@RequestBody @Valid RoleAuthVO roleAuthVO);

    /**
     * 设置（新增、修改、删除）角色关联的会员配置资料
     * @param configVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/set/config", method = RequestMethod.POST)
    Wrapper<?> setRoleConfig(@RequestBody @Valid RoleConfigVO configVO);

    /**
     * 新增或修改角色关联的平台会员审核流程
     * @param platformProcessVO 接口参数
     * @return 操作结果
     */
    @RequestMapping(value = "/set/process", method = RequestMethod.POST)
    Wrapper<Void> insertOrUpdateBasePlatformProcess(@RequestBody @Valid PlatformProcessRuleVO platformProcessVO);
}
